import { http } from "@/utils/http";


/**
 * 可能为空
 */
export interface OfficialCharactersInfo {

  /**
   * 金元
   */
  bountygold: number;
  /**
   * 峡谷币
   */
  currency8: number;
  /**
   * 峡谷等级
   */
  danlv: number;
  /**
   * 元宝
   */
  gold: number;
  /**
   * 贵族等级
   */
  guizuLv: number;
  /**
   * 角色id
   */
  roleid: number;
  /**
   * 角色名字
   */
  rolename: string;
  [property: string]: any;
}
/**
 * 给出渠道角色
 * @returns 
 * @param Pin
 */
export const getOfficialCharacters = (Pin?: string) => {
  return http.get<OfficialCharactersInfo>('/role/get', { params: { Pin } });
};





export interface ThirdChannlRoleInformation {
  serverGroupList: ServerGroupList[];
  version: string;
  [property: string]: any;
}

export interface ServerGroupList {
  id: number;
  name: string;
  serverList: ServerList[];
  type: number;
  [property: string]: any;
}

export interface ServerList {
  combinedTo: number;
  comHistory: null | string;
  differmsec: number;
  domainName: string;
  h5port: number;
  id: number;
  ip: string;
  name: string;
  no: number;
  opentime: number;
  platweb: string;
  port: number;
  serverRes: null | string;
  showWinnerName: number;
  state: number;
  webId: number;
  winnerName: string;
  [property: string]: any;
}
/**
 * 给出第三方角色信息
 * @returns 
 */
export const getThirdChannlRoleInformation = () => {
  return http.get<ThirdChannlRoleInformation>('/role/server');
};

/**
 * 创建官方角色
 */
export const createOfficialRole = (data: { name: string, serverid: string | number }) => {
  return http.post('/role/create', { data });
}
/**
 * 绑定角色到官网
 */
export const mergeRole = (data: { pin: string | number }) => {
  return http.post('/role/merge', { data });
}